From: Owen W. Taylor Date: Sat, 29 Aug 2009 17:25:32 +0000 (-0400) Subject: ShellButtonBox: only listen to button 1 and single clicks X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10989 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0fd6bc517241b5ae222a873e8568e72e41c71aa2;p=gnome-shell.git ShellButtonBox: only listen to button 1 and single clicks Only mouse button 1 is supposed to activate button controls; other mouse buttons should do nothing unless there is a context menu. Checking the click count is important, since double-clicks will otherwise look like unpaired button presses. http://bugzilla.gnome.org/show_bug.cgi?id=593504 --- diff --git a/src/shell-button-box.c b/src/shell-button-box.c index 56dd94410..a7f54c38e 100644 --- a/src/shell-button-box.c +++ b/src/shell-button-box.c @@ -117,6 +117,9 @@ shell_button_box_button_press_event (ClutterActor *actor, { ShellButtonBox *box = SHELL_BUTTON_BOX (actor); + if (event->button != 1 || event->click_count != 1) + return FALSE; + if (box->priv->held) return TRUE; @@ -137,6 +140,9 @@ shell_button_box_button_release_event (ClutterActor *actor, { ShellButtonBox *box = SHELL_BUTTON_BOX (actor); + if (event->button != 1 || event->click_count != 1) + return FALSE; + if (!box->priv->held) return TRUE;